package IC.SymbolTable;

import java.util.ArrayList;
import java.util.List;

public class SymbolTable {



	protected String symTableId;
	protected SymbolTable parentSymbolTable;
	protected List<SymbolTable> childrenSymbolTables;
	
	protected symbolTableType stt;


	//**********************************************************	

	

	// constructor
	public SymbolTable(String id, SymbolTable parent) 
	{
	
		this.childrenSymbolTables = new ArrayList<SymbolTable>();
		this.symTableId = id;
		this.parentSymbolTable = parent;
/*
		if (parentSymbolTable != null)
		{
			parentSymbolTable.addChildTable(this.symTableId, this);
		}*/

	}

	//**********************************************************	

	// setters and getters

	



	public String getId() 
	{
		return symTableId;
	}

	

	public SymbolTable getParent() 
	{
		return parentSymbolTable;
	}

	public void setParent(SymbolTable parent) 
	{
		this.parentSymbolTable = parent;
	}

	public List<SymbolTable> getChildren() 
	{
		return childrenSymbolTables;
	}

	

	
	public symbolTableType getStt() {
		return stt;
	}

	public void setStt(symbolTableType stt) {
		this.stt = stt;
	}
	
	
	//**********************************************************

	public void addChildTable(String childID, SymbolTable child) 
	{
		childrenSymbolTables.add(child);
		child.setParent(this);		
	}

	
	

}
